python mysqldb

40

python mysqldb -

import MySQLdb

db = MySQLdb.connect(db=dbname, host=dbhost, user=dbuser, passwd=dbpass)

cursor = db.cursor()
cursor.execute("SELECT NOW();")

d = cursor.fetchone()
print("Now: ", d[0])

db.close()

Comments

Submit
0 Comments